﻿using System.Data;
using PolePositionMobileUtilityGeneral;

namespace PolePositionMobileUtilityEntity
{
    public class ETreatment : ELookup
    {
        public ETreatment()
            : base()
        {
            m_TableColumnType = "Treatments";
        }

        public ETreatment(int id, string name)
            : this()
        {
            Id = id;
            Name = name;
        }

        public ETreatment[] GetAll()
        {
            DataTable _dt = SelectAll();
            ETreatment[] arr = new ETreatment[_dt.Rows.Count];
            for (int i = 0; i < _dt.Rows.Count; i++)
            {
                arr[i] = new ETreatment(ConvertMobileHelper.ToInt32(_dt.Rows[i][m_TableCollumnId]), ConvertMobileHelper.Tostring(_dt.Rows[i][m_TableCollumnName]));
            }
            return arr;
        } 
    }
}
